﻿<%@ Page Title="Giới thiệu bạn bè" Language="C#" MasterPageFile="~/Masters/PageOneColumn.master" AutoEventWireup="true" CodeFile="InviteFriends.aspx.cs" Inherits="InviteFriends" %>

<asp:Content ID="Content1" ContentPlaceHolderID="title" Runat="Server">
    <link href="Styles/style.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        function showFullBookDescription(fullTextIntem) {
            var item = document.getElementById('short-description');
            var textItem = document.getElementById(fullTextIntem);
            if (item != null && item != undefined) {
                if (item.innerText == undefined)
                    item.textContent = textItem.value;
                else
                    item.innerText = textItem.value;
            }
            return false;
        }

        function formsubmit(el) {
            if (!el)
                return false;
            if (el.tagName == 'FORM')
                el.submit();
            else
                return formsubmit(el.parentNode)
            return false;
        }
    </script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderContentClearFix" Runat="Server">

    <form id="form1" runat="server">

<%
    int id = 0;
    try
    {
        id = int.Parse(Request.QueryString["ID"]);
    }
    catch { }
    
    NhaKinhDoanhDataContext db = new NhaKinhDoanhDataContext();

    var query = (from sp in db.TaiLieus
                where sp.ProductID == id
                select sp).Take(1);
    if (query.Count<TaiLieu>() == 0)
    {
        query = (from sp in db.TaiLieus
                 select sp).Take(1);
    }

    TaiLieu tl = query.Single<TaiLieu>();

%>
<!-- Begin: content book-details clearfix -->
<div class="content book-details clearfix">   
    <!-- Begin: book info -->
    <div class="book-info">

		<div class="book-shadow">
			<img width="168" height="178" src="<%= tl.ProductPhotoURL %>" 
                alt="<%= tl.ProductName %>" class="book-detail-img" title="<%= tl.ProductName %>"/>
		</div>
		<div class="book-box">        
			<span onclick="return formsubmit($$('#cartaddform'))" class="start-read link">Thêm vào giỏ hàng</span>            
		</div>		

        <div class="price-device-box clearfix" style="padding-top:10px;">
			            			
			<div class="service-links">
		            <input type="hidden" id="IID" value="<%= tl.ProductID %>" name="IID"/>
		            <input type="hidden" id="Act" value="1" name="Act"/>
                    <input type="hidden" value="16" id="FID" name="FID"/>
					                    
				    <ul>						
						<li><span onclick="formsubmit(this)" class="buy-it link">Mua sản phẩm này</span></li>
				    </ul>
			</div>            
		</div>

	</div>
    <!-- end: book info -->

    <!-- Begin: floatLeft -->
    <div class="floatLeft">
        <div class="book-info-head">
            <h1><%= tl.ProductName%></h1>
		    <div class="authors"> 
                <a href="Category.aspx?CateID=<%= tl.CatID %>"> <%= tl.DanhMuc.CatName %></a>
            </div>            
        </div>

        <div class="book-info-body">
        
      <div class="MailBox">

                <!-- Begin: MailRow -->
    		    <div class="MailRow">
                    <!-- Start Notification -->
                     <div id="NotificationMessage" runat="server"></div>  
                    <!-- End Notification -->
    		    </div> <!-- End: MailRow -->

                       <!-- Begin: MailRow -->
    		    <div class="MailRow">
                 <!-- Begin: MailRow Left-->
    		      <div class="MailLeft">
    		       Tên của bạn (*): 		        
   		         </div> <!-- End: MailRow Left-->
                  <!-- Begin: MailRow Right-->
                   <div class="MailRight">                     
                      <asp:TextBox ID="txtFullName"  runat="server" CssClass="textbox"></asp:TextBox>
                  </div> <!-- End: MailRow Right-->
                   <div class="clear"></div>
    		    </div> <!-- End: MailRow -->     

                 <!-- Begin: MailRow -->
    		    <div class="MailRow">
                 <!-- Begin: MailRow Left-->
    		      <div class="MailLeft">
    		       Email của bạn (*): 		        
   		         </div> <!-- End: MailRow Left-->
                  <!-- Begin: MailRow Right-->
                   <div class="MailRight">                     
                      <asp:TextBox ID="txtEmailFrom"  runat="server" CssClass="textbox"></asp:TextBox>
                  </div> <!-- End: MailRow Right-->
                   <div class="clear"></div>
    		    </div> <!-- End: MailRow -->
                

    		    <!-- Begin: MailRow -->
    		    <div class="MailRow">
                 <!-- Begin: MailRow Left-->
    		      <div class="MailLeft">
    		        Email người nhận(*):   		        
   		         </div> <!-- End: MailRow Left-->
                  <!-- Begin: MailRow Right-->
                   <div class="MailRight">                     
                      <asp:TextBox ID="txtEmailTo"  runat="server" CssClass="textbox"></asp:TextBox>
                  </div> <!-- End: MailRow Right-->
                   <div class="clear"></div>
    		    </div> <!-- End: MailRow -->
                
              
                
                 <!-- Begin: MailRow -->
    		    <div class="MailRow">
                 <!-- Begin: MailRow Left-->
    		      <div class="MailLeft">    		      		        
   		         </div> <!-- End: MailRow Left-->
                  <!-- Begin: MailRow Right-->
                  <div class="MailRight">                     
                    <asp:Button runat="server" Text="Gửi" cssClass="button" id="btnSend" onclick="btnSend_Click" 
                           /> 
                  </div> 

                   <!-- End:MailRow Right-->
                   <div class="clear"></div>
    		    </div> <!-- End: MailRow -->

                
    		  </div>
        </div>
    </div>  <!-- end: floatLeft -->
</div><!-- End: content book-details clearfix -->  
    </form>
</asp:Content>